package org.gap.domain;

import java.io.Serializable;

import java.lang.StringBuilder;

import java.util.Calendar;
import java.util.Set;

import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;

import javax.xml.bind.annotation.*;

import javax.persistence.*;

/**
 */
@IdClass(org.gap.domain.TiersRibPK.class)
@Entity
@NamedQueries({
		@NamedQuery(name = "findAllTiersRibs", query = "select myTiersRib from TiersRib myTiersRib"),
		@NamedQuery(name = "findTiersRibByPrimaryKey", query = "select myTiersRib from TiersRib myTiersRib where myTiersRib.trbTiers = ?1 and myTiersRib.trbRib = ?2"),
		@NamedQuery(name = "findTiersRibByTrbBic", query = "select myTiersRib from TiersRib myTiersRib where myTiersRib.trbBic = ?1"),
		@NamedQuery(name = "findTiersRibByTrbBicContaining", query = "select myTiersRib from TiersRib myTiersRib where myTiersRib.trbBic like ?1"),
		@NamedQuery(name = "findTiersRibByTrbCleRib", query = "select myTiersRib from TiersRib myTiersRib where myTiersRib.trbCleRib = ?1"),
		@NamedQuery(name = "findTiersRibByTrbCompte", query = "select myTiersRib from TiersRib myTiersRib where myTiersRib.trbCompte = ?1"),
		@NamedQuery(name = "findTiersRibByTrbCompteContaining", query = "select myTiersRib from TiersRib myTiersRib where myTiersRib.trbCompte like ?1"),
		@NamedQuery(name = "findTiersRibByTrbDateCreation", query = "select myTiersRib from TiersRib myTiersRib where myTiersRib.trbDateCreation = ?1"),
		@NamedQuery(name = "findTiersRibByTrbDateCreationAfter", query = "select myTiersRib from TiersRib myTiersRib where myTiersRib.trbDateCreation > ?1"),
		@NamedQuery(name = "findTiersRibByTrbDateCreationBefore", query = "select myTiersRib from TiersRib myTiersRib where myTiersRib.trbDateCreation < ?1"),
		@NamedQuery(name = "findTiersRibByTrbDateModification", query = "select myTiersRib from TiersRib myTiersRib where myTiersRib.trbDateModification = ?1"),
		@NamedQuery(name = "findTiersRibByTrbDateModificationAfter", query = "select myTiersRib from TiersRib myTiersRib where myTiersRib.trbDateModification > ?1"),
		@NamedQuery(name = "findTiersRibByTrbDateModificationBefore", query = "select myTiersRib from TiersRib myTiersRib where myTiersRib.trbDateModification < ?1"),
		@NamedQuery(name = "findTiersRibByTrbDenomDom", query = "select myTiersRib from TiersRib myTiersRib where myTiersRib.trbDenomDom = ?1"),
		@NamedQuery(name = "findTiersRibByTrbDenomDomContaining", query = "select myTiersRib from TiersRib myTiersRib where myTiersRib.trbDenomDom like ?1"),
		@NamedQuery(name = "findTiersRibByTrbDenomGuichet", query = "select myTiersRib from TiersRib myTiersRib where myTiersRib.trbDenomGuichet = ?1"),
		@NamedQuery(name = "findTiersRibByTrbDenomGuichetContaining", query = "select myTiersRib from TiersRib myTiersRib where myTiersRib.trbDenomGuichet like ?1"),
		@NamedQuery(name = "findTiersRibByTrbEtablissement", query = "select myTiersRib from TiersRib myTiersRib where myTiersRib.trbEtablissement = ?1"),
		@NamedQuery(name = "findTiersRibByTrbGuichet", query = "select myTiersRib from TiersRib myTiersRib where myTiersRib.trbGuichet = ?1"),
		@NamedQuery(name = "findTiersRibByTrbGuichetContaining", query = "select myTiersRib from TiersRib myTiersRib where myTiersRib.trbGuichet like ?1"),
		@NamedQuery(name = "findTiersRibByTrbGuichetDom", query = "select myTiersRib from TiersRib myTiersRib where myTiersRib.trbGuichetDom = ?1"),
		@NamedQuery(name = "findTiersRibByTrbGuichetDomContaining", query = "select myTiersRib from TiersRib myTiersRib where myTiersRib.trbGuichetDom like ?1"),
		@NamedQuery(name = "findTiersRibByTrbIban", query = "select myTiersRib from TiersRib myTiersRib where myTiersRib.trbIban = ?1"),
		@NamedQuery(name = "findTiersRibByTrbIbanContaining", query = "select myTiersRib from TiersRib myTiersRib where myTiersRib.trbIban like ?1"),
		@NamedQuery(name = "findTiersRibByTrbPays", query = "select myTiersRib from TiersRib myTiersRib where myTiersRib.trbPays = ?1"),
		@NamedQuery(name = "findTiersRibByTrbPaysContaining", query = "select myTiersRib from TiersRib myTiersRib where myTiersRib.trbPays like ?1"),
		@NamedQuery(name = "findTiersRibByTrbRib", query = "select myTiersRib from TiersRib myTiersRib where myTiersRib.trbRib = ?1"),
		@NamedQuery(name = "findTiersRibByTrbRibValide", query = "select myTiersRib from TiersRib myTiersRib where myTiersRib.trbRibValide = ?1"),
		@NamedQuery(name = "findTiersRibByTrbTiers", query = "select myTiersRib from TiersRib myTiersRib where myTiersRib.trbTiers = ?1"),
		@NamedQuery(name = "findTiersRibByTrbTitulaire", query = "select myTiersRib from TiersRib myTiersRib where myTiersRib.trbTitulaire = ?1"),
		@NamedQuery(name = "findTiersRibByTrbTitulaireContaining", query = "select myTiersRib from TiersRib myTiersRib where myTiersRib.trbTitulaire like ?1") })
@Table(schema = "GAP", name = "TIERS_RIB")
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(namespace = "GAP_v2/org/gap/domain", name = "TiersRib")
public class TiersRib implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 */

	@Column(name = "TRB_TIERS", nullable = false)
	@Basic(fetch = FetchType.EAGER)
	@Id
	@XmlElement
	Integer trbTiers;
	/**
	 */

	@Column(name = "TRB_RIB", nullable = false)
	@Basic(fetch = FetchType.EAGER)
	@Id
	@XmlElement
	Integer trbRib;
	/**
	 */

	@Column(name = "TRB_PAYS", length = 3)
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String trbPays;
	/**
	 */

	@Column(name = "TRB_ETABLISSEMENT")
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	Integer trbEtablissement;
	/**
	 */

	@Column(name = "TRB_GUICHET", length = 5)
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String trbGuichet;
	/**
	 */

	@Column(name = "TRB_DENOM_GUICHET", length = 25)
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String trbDenomGuichet;
	/**
	 */

	@Column(name = "TRB_COMPTE", length = 11)
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String trbCompte;
	/**
	 */

	@Column(name = "TRB_CLE_RIB")
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	Integer trbCleRib;
	/**
	 */

	@Column(name = "TRB_GUICHET_DOM", length = 5)
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String trbGuichetDom;
	/**
	 */

	@Column(name = "TRB_DENOM_DOM", length = 25)
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String trbDenomDom;
	/**
	 */

	@Column(name = "TRB_TITULAIRE", length = 60)
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String trbTitulaire;
	/**
	 */

	@Column(name = "TRB_RIB_VALIDE")
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	Boolean trbRibValide;
	/**
	 */

	@Column(name = "TRB_IBAN", length = 34)
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String trbIban;
	/**
	 */

	@Column(name = "TRB_BIC", length = 11)
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String trbBic;
	/**
	 */
	@Temporal(TemporalType.DATE)
	@Column(name = "TRB_DATE_CREATION")
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	Calendar trbDateCreation;
	/**
	 */
	@Temporal(TemporalType.DATE)
	@Column(name = "TRB_DATE_MODIFICATION")
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	Calendar trbDateModification;

	/**
	 */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumns({ @JoinColumn(name = "TRB_USER_CREATION", referencedColumnName = "USR_USER") })
	@XmlTransient
	Utilisateurs utilisateursByTrbUserCreation;
	/**
	 */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumns({ @JoinColumn(name = "TRB_USER_MODIFICATION", referencedColumnName = "USR_USER") })
	@XmlTransient
	Utilisateurs utilisateursByTrbUserModification;

	/**
	 */
	public void setTrbTiers(Integer trbTiers) {
		this.trbTiers = trbTiers;
	}

	/**
	 */
	public Integer getTrbTiers() {
		return this.trbTiers;
	}

	/**
	 */
	public void setTrbRib(Integer trbRib) {
		this.trbRib = trbRib;
	}

	/**
	 */
	public Integer getTrbRib() {
		return this.trbRib;
	}

	/**
	 */
	public void setTrbPays(String trbPays) {
		this.trbPays = trbPays;
	}

	/**
	 */
	public String getTrbPays() {
		return this.trbPays;
	}

	/**
	 */
	public void setTrbEtablissement(Integer trbEtablissement) {
		this.trbEtablissement = trbEtablissement;
	}

	/**
	 */
	public Integer getTrbEtablissement() {
		return this.trbEtablissement;
	}

	/**
	 */
	public void setTrbGuichet(String trbGuichet) {
		this.trbGuichet = trbGuichet;
	}

	/**
	 */
	public String getTrbGuichet() {
		return this.trbGuichet;
	}

	/**
	 */
	public void setTrbDenomGuichet(String trbDenomGuichet) {
		this.trbDenomGuichet = trbDenomGuichet;
	}

	/**
	 */
	public String getTrbDenomGuichet() {
		return this.trbDenomGuichet;
	}

	/**
	 */
	public void setTrbCompte(String trbCompte) {
		this.trbCompte = trbCompte;
	}

	/**
	 */
	public String getTrbCompte() {
		return this.trbCompte;
	}

	/**
	 */
	public void setTrbCleRib(Integer trbCleRib) {
		this.trbCleRib = trbCleRib;
	}

	/**
	 */
	public Integer getTrbCleRib() {
		return this.trbCleRib;
	}

	/**
	 */
	public void setTrbGuichetDom(String trbGuichetDom) {
		this.trbGuichetDom = trbGuichetDom;
	}

	/**
	 */
	public String getTrbGuichetDom() {
		return this.trbGuichetDom;
	}

	/**
	 */
	public void setTrbDenomDom(String trbDenomDom) {
		this.trbDenomDom = trbDenomDom;
	}

	/**
	 */
	public String getTrbDenomDom() {
		return this.trbDenomDom;
	}

	/**
	 */
	public void setTrbTitulaire(String trbTitulaire) {
		this.trbTitulaire = trbTitulaire;
	}

	/**
	 */
	public String getTrbTitulaire() {
		return this.trbTitulaire;
	}

	/**
	 */
	public void setTrbRibValide(Boolean trbRibValide) {
		this.trbRibValide = trbRibValide;
	}

	/**
	 */
	public Boolean getTrbRibValide() {
		return this.trbRibValide;
	}

	/**
	 */
	public void setTrbIban(String trbIban) {
		this.trbIban = trbIban;
	}

	/**
	 */
	public String getTrbIban() {
		return this.trbIban;
	}

	/**
	 */
	public void setTrbBic(String trbBic) {
		this.trbBic = trbBic;
	}

	/**
	 */
	public String getTrbBic() {
		return this.trbBic;
	}

	/**
	 */
	public void setTrbDateCreation(Calendar trbDateCreation) {
		this.trbDateCreation = trbDateCreation;
	}

	/**
	 */
	public Calendar getTrbDateCreation() {
		return this.trbDateCreation;
	}

	/**
	 */
	public void setTrbDateModification(Calendar trbDateModification) {
		this.trbDateModification = trbDateModification;
	}

	/**
	 */
	public Calendar getTrbDateModification() {
		return this.trbDateModification;
	}

	/**
	 */
	public void setUtilisateursByTrbUserCreation(Utilisateurs utilisateursByTrbUserCreation) {
		this.utilisateursByTrbUserCreation = utilisateursByTrbUserCreation;
	}

	/**
	 */
	public Utilisateurs getUtilisateursByTrbUserCreation() {
		return utilisateursByTrbUserCreation;
	}

	/**
	 */
	public void setUtilisateursByTrbUserModification(Utilisateurs utilisateursByTrbUserModification) {
		this.utilisateursByTrbUserModification = utilisateursByTrbUserModification;
	}

	/**
	 */
	public Utilisateurs getUtilisateursByTrbUserModification() {
		return utilisateursByTrbUserModification;
	}

	/**
	 */
	public TiersRib() {
	}

	/**
	 * Copies the contents of the specified bean into this bean.
	 *
	 */
	public void copy(TiersRib that) {
		setTrbTiers(that.getTrbTiers());
		setTrbRib(that.getTrbRib());
		setTrbPays(that.getTrbPays());
		setTrbEtablissement(that.getTrbEtablissement());
		setTrbGuichet(that.getTrbGuichet());
		setTrbDenomGuichet(that.getTrbDenomGuichet());
		setTrbCompte(that.getTrbCompte());
		setTrbCleRib(that.getTrbCleRib());
		setTrbGuichetDom(that.getTrbGuichetDom());
		setTrbDenomDom(that.getTrbDenomDom());
		setTrbTitulaire(that.getTrbTitulaire());
		setTrbRibValide(that.getTrbRibValide());
		setTrbIban(that.getTrbIban());
		setTrbBic(that.getTrbBic());
		setTrbDateCreation(that.getTrbDateCreation());
		setTrbDateModification(that.getTrbDateModification());
		setUtilisateursByTrbUserCreation(that.getUtilisateursByTrbUserCreation());
		setUtilisateursByTrbUserModification(that.getUtilisateursByTrbUserModification());
	}

	/**
	 * Returns a textual representation of a bean.
	 *
	 */
	public String toString() {

		StringBuilder buffer = new StringBuilder();

		buffer.append("trbTiers=[").append(trbTiers).append("] ");
		buffer.append("trbRib=[").append(trbRib).append("] ");
		buffer.append("trbPays=[").append(trbPays).append("] ");
		buffer.append("trbEtablissement=[").append(trbEtablissement).append("] ");
		buffer.append("trbGuichet=[").append(trbGuichet).append("] ");
		buffer.append("trbDenomGuichet=[").append(trbDenomGuichet).append("] ");
		buffer.append("trbCompte=[").append(trbCompte).append("] ");
		buffer.append("trbCleRib=[").append(trbCleRib).append("] ");
		buffer.append("trbGuichetDom=[").append(trbGuichetDom).append("] ");
		buffer.append("trbDenomDom=[").append(trbDenomDom).append("] ");
		buffer.append("trbTitulaire=[").append(trbTitulaire).append("] ");
		buffer.append("trbRibValide=[").append(trbRibValide).append("] ");
		buffer.append("trbIban=[").append(trbIban).append("] ");
		buffer.append("trbBic=[").append(trbBic).append("] ");
		buffer.append("trbDateCreation=[").append(trbDateCreation).append("] ");
		buffer.append("trbDateModification=[").append(trbDateModification).append("] ");

		return buffer.toString();
	}

	/**
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = (int) (prime * result + ((trbTiers == null) ? 0 : trbTiers.hashCode()));
		result = (int) (prime * result + ((trbRib == null) ? 0 : trbRib.hashCode()));
		return result;
	}

	/**
	 */
	public boolean equals(Object obj) {
		if (obj == this)
			return true;
		if (!(obj instanceof TiersRib))
			return false;
		TiersRib equalCheck = (TiersRib) obj;
		if ((trbTiers == null && equalCheck.trbTiers != null) || (trbTiers != null && equalCheck.trbTiers == null))
			return false;
		if (trbTiers != null && !trbTiers.equals(equalCheck.trbTiers))
			return false;
		if ((trbRib == null && equalCheck.trbRib != null) || (trbRib != null && equalCheck.trbRib == null))
			return false;
		if (trbRib != null && !trbRib.equals(equalCheck.trbRib))
			return false;
		return true;
	}
}
